﻿
using Dapper;
using System.Data;
using System.Linq;
namespace hdal.sqlserver {
    internal class SequenceIdServer : AbsSequenceIdServer, ISequenceIdServer {
        public override long querySequence(IDbConnection connection ,IDbTransaction transaction) {
             if( connection == null ) {
                return Connection.Query<long>("SELECT NEXT VALUE FOR sequence_id").Single();
            } else {
                return connection.Query<long>("SELECT NEXT VALUE FOR sequence_id",null,transaction).Single();
             }
         
        }
    }
}
